﻿
#include <cstdio>
#include <BApplication>

#include "Config.h"
#include "MainWindow.h"

#ifdef _WIN32
//#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
#endif

int main(int argc, char** argv)
{
	BApplication app(argc, argv);
	app.setCurrentPath(app.appPath());
	app.setStyleSheet("data/style/docgen.css");

	Config* config = new Config(app.homePath() + "/docgen/config.xml");
	config->load();
	app.setProperty("config", config);

	MainWindow mw;
	mw.setTitle("Docgen");
	mw.show();

	if (argc > 1)
	{
		const BString& fileName = app.argv(1);
		mw.openHtmlFile(fileName);
		if (BWidget* widget = mw.find("hierarchy"))
		{
			widget->show();
		}
	}
	return app.execute();
}